package com.shelpe.services.scheduler.item.campaign;

import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.NonTransientResourceException;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.shelpe.services.scheduler.po.Campaigns;
import com.shelpe.services.scheduler.repository.CampaignsRepository;

@Component("campaignReader")
public class CampaignReaderImpl implements ItemReader<Campaigns>{

	@Autowired
	private CampaignsRepository camRep;
	
	@Override
	public Campaigns read()
			throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {
		// TODO Auto-generated method stub
		return camRep.findOne(0L);
	}

}
